import E from 'wangeditor';
let wangeditor = {};

wangeditor.fun1 = function (el) {
    this.editor = new E('#editorElem');
    this.editor.customConfig.onchange = (html) => {
        el = html;
    };
    this.editor.customConfig.uploadImgServer = 'http://192.168.10.205:6650/v1/document/document/view/uploadDocument?type=PRODUCT';
    this.editor.customConfig.uploadFileName = 'file';
    this.editor.customConfig.uploadImgHooks = {
        customInsert: function (insertImg, result, editor) {
            var url = result.data.accessUrl;
            insertImg(url);
        }
    };
    this.editor.create();
};

export default () => {
    window.wangeditor = wangeditor;
};